Page({
  data: {
    account: '',
    password: ""

  },
  onLoad(options) {

  },

  onChange(e) {
    const { type } = e.currentTarget.dataset
    const value = e.detail
    this.setData({
      [type]: value
    })
  },
  submitAlbum() {
    if (!this.data.account || !this.data.password) {
      return wx.showToast({ title: '请输入', icon: 'none' });
    } else if (this.data.account !== 'admin' && this.data.password !== 'admin') {
      return wx.showToast({ title: '请输入正确的账号', icon: 'none' });
    } else {
      wx.setStorageSync('isAdmin', true)
      wx.navigateBack(-1)
    }
  },
  onReady() {

  },
  onShow() {

  },
  onHide() {

  },
  onUnload() {

  },
  onShareAppMessage() {
    return {
      title: '',
    };
  },
});